<html><head><title>While : Wend</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="5">While : Wend</font></b></p>

<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#3A3966">While</font></b> &lt;expression&gt;
  ...
<b><font color="#3A3966">Wend</font></b>
</font></pre></blockquote>
<b>Description</b><br><blockquote>


<b><font color="#3A3966">Wend</font></b> will loop until the &lt;expression&gt; becomes false. A good point to keep in mind with a <b><font color="#3A3966">While</font></b> test 
is that if the first test is false, then the program will never enter the loop and will skip this part. 
A <a href="repeat_until.html">Repeat</a> loop is executed at least once, (as the test is performed after each loop). <br>
<br>
With the <a href="break_continue.html">Break</a> command it is possible to exit the <b><font color="#3A3966">While</font></b> : <b><font color="#3A3966">Wend</font></b> loop during any iteration, 
with the <a href="break_continue.html">Continue</a> command the end of the current iteration may be skipped. 

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  b = 0
  a = 10
  <b><font color="#3A3966">While</font></b> a = 10 
    b = b+1 
    <b><font color="#3A3966">If</font></b> b=10 
      a=11 
    <b><font color="#3A3966">EndIf</font></b> 
  <b><font color="#3A3966">Wend</font></b> 
</font></pre>

This program loops until the 'a' value is &lt;&gt; 10. The value of 'a' becomes 11 when b=10, the program will loop 10 times. 
</body></html>